﻿using System;
using System.Collections;
using System.Data;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.SessionState;
using Rison.BusinessFacade.Common;
using Rison.DataAccess.Data.ZJCP;

namespace Rison.Web.ZJCP.ashx
{
    /// <summary>
    /// $codebehindclassname$ 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class judge_expert_user : IHttpHandler, IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/html";
            context.Response.Write(String.Format("_judgeExpertUser={0};",judegExpertUser().ToString().ToLower()));
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
        private Boolean judegExpertUser()
        {
            string strsql = String.Format("select count(1) from expert t where t.ex_user_name='{0}'", CurrentLoginedUser.UserName);
            DataSet ds = DbAccess.executeQuery(strsql);
            return ((int)(ds.Tables[0].Rows[0][0])) > 0;
        }
    }
}
